/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package photoshare.services;

import java.sql.SQLException;
import java.util.ArrayList;
import photoshare.dao.CommentDAO;
import photoshare.dto.CommentDTO;

/**
 *
 * @author PhotoShare
 */
public class CommentService {

    public CommentService() {
    }

     public boolean create(CommentDTO commentDTO) throws SQLException {
        return new CommentDAO().create(commentDTO);
    }

    public ArrayList<CommentDTO> findAll() {
        return new CommentDAO().readAll();
    }

    public CommentDTO readById(Integer commentId) throws Exception{
        return new CommentDAO().readById(commentId);
    }

    public boolean updateById(CommentDTO commentDTO, Integer commentId) throws SQLException {
        return new CommentDAO().updateById(commentDTO, commentId);
    }

    public boolean deleteById(Integer commentId) throws SQLException {

        return new CommentDAO().deleteById(commentId);
    }

}
